//---------------------------------------------------------------------------
#ifndef TD_MainH
#define TD_MainH
//---------------------------------------------------------------------------

#include "Globals.h"

#include <Forms.hpp>

#include <Classes.hpp>
#include <ComCtrls.hpp>
#include <Controls.hpp>
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>
#include <Menus.hpp>
#include <StdCtrls.hpp>


//---------------------------------------------------------------------------
class TmyForm : public TForm
{
__published:	// IDE-managed Components
  TPaintBox *Video;
  TMainMenu *MainMenu1;
  TMenuItem *File1;
  TMenuItem *OpenBinaryTextData1;
  TMenuItem *N1;
  TMenuItem *SaveTextFile1;
  TMenuItem *Exit1;
  TOpenDialog *Open1;
 TSaveDialog *FSave;
  TMenuItem *LoadDataFile;
  TStatusBar *StatusBar1;
  TMenuItem *N2;
  TFindDialog *Find1;
  TMenuItem *View1;
  TMenuItem *DisplayTextEditor1;
  TMenuItem *N3;
  TMenuItem *HideCodes;
  TMenuItem *UseVWFRoutine1;
  TMenuItem *DTT;
  TMenuItem *N4;
  TMenuItem *DefaultWindowSize1;
  TMenuItem *ViewHexData1;
  TMenuItem *Program1;
  TMenuItem *DumpMemory1;
  TMenuItem *TextboxColor1;
  TMenuItem *Blue1;
  TMenuItem *Green1;
  TMenuItem *Red1;
  TMenuItem *N5;
  TMenuItem *Solid1;
  TMenuItem *Gradient1;

  TMenuItem *N6;
  TMenuItem *TEOnTop;
  TMenuItem *ViewKanaTextDump1;
  TMenuItem *Window1;
  TMenuItem *Zoominx21;
  TMenuItem *Edit1;
  TMenuItem *Insert1;
  TMenuItem *N7;
  TMenuItem *InsertCOMPRESSIONintoROM1;
  TMenuItem *LoadTableFile1;
  TMenuItem *SaveRomFile1;
  TMenuItem *InsertMULTI;
  TListBox *ptrBox;
 TMenuItem *PATCHRomFile1;
 TMenuItem *ViewKanaDump1;
 TMenuItem *DumpKanatoafile1;
  void __fastcall OpenBinaryTextData1Click(TObject *Sender);
  void __fastcall SaveTextFile1Click(TObject *Sender);
  void __fastcall Exit1Click(TObject *Sender);
  void __fastcall LoadDataFileClick(TObject *Sender);
  void __fastcall FormCreate(TObject *Sender);
  void __fastcall FormClose(TObject *Sender, TCloseAction &Action);

  void __fastcall VideoPaint(TObject *Sender);
  void __fastcall pListClick(TObject *Sender);
  void __fastcall bListClick(TObject *Sender);
  void __fastcall Find1Find(TObject *Sender);

  void __fastcall DisplayTextEditor1Click(TObject *Sender);

  void __fastcall HideCodesClick(TObject *Sender);
  void __fastcall UseVWFRoutine1Click(TObject *Sender);
  void __fastcall DTTClick(TObject *Sender);
  void __fastcall FormResize(TObject *Sender);
  void __fastcall DefaultWindowSize1Click(TObject *Sender);
  void __fastcall Red1Click(TObject *Sender);
  void __fastcall TEOnTopClick(TObject *Sender);
  void __fastcall ViewHexData1Click(TObject *Sender);
  void __fastcall ViewKanaTextDump1Click(TObject *Sender);

  void __fastcall Zoominx21Click(TObject *Sender);
  void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);

  void __fastcall LoadTableFile1Click(TObject *Sender);
  void __fastcall InsertCOMPRESSIONintoROM1Click(TObject *Sender);
  void __fastcall SaveRomFile1Click(TObject *Sender);
  void __fastcall Insert1Click(TObject *Sender);
 void __fastcall PATCHRomFile1Click(TObject *Sender);
 void __fastcall DumpKanatoafile1Click(TObject *Sender);
 void __fastcall ViewKanaDump1Click(TObject *Sender);
private:	// User declarations
public:		// User declarations
  __fastcall TmyForm(TComponent* Owner);

  void __fastcall DrawText( bool skip, int height, int width );
  void __fastcall DecodeFont( LONG posi, BYTE *TILE );
  long __fastcall GetCurLine( long valu );
  void __fastcall TableLoader( char *tblFile );
  long __fastcall Text2Raw( int index );
  void __fastcall Compress(TObject *Sender);
};

//---------------------------------------------------------------------------
extern PACKAGE TmyForm *myForm;
//---------------------------------------------------------------------------
#endif
